/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       fileloader.h
 * Author:     karooolek
 * Created on: 2009-03-22
 *
 **********************************************************************************************************************/

#ifndef FILELOADER_H_
#define FILELOADER_H_

#include "loader.h"
#include "string.h"

namespace mGameEngine
{

/**
 * Base class for files loaders.
 */
class FileLoader : public Loader
{
protected:
    /**
     * File name
     */
    String _filename;

    /**
     * File path
     */
    String _path;

    /**
     * File extension
     */
    String _extension;

public:
    /**
     * Create loader with no specified file.
     */
    FileLoader();

    /**
     * Create loader with specified resource file name.
     * @param filename file name
     */
    FileLoader(const String &filename);

    /**
     * Destroy file loader.
     */
    virtual ~FileLoader();

    /**
     * Get file name.
     * @return file name
     */
    const String &getFileName() const
    {
        return _filename;
    }

    /**
     * Get file path.
     * @return file path.
     */
    const String &getFilePath() const
    {
        return _path;
    }

    /**
     * Get file extension.
     * @return file extension.
     */
    const String &getFileExtension() const
    {
        return _extension;
    }

    /**
     * Set file name.
     * File extension will be set automatically.
     * @param filename file name
     */
    void setFileName(const String &filename);
};

}

#endif // FILELOADER_H_
